/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * @author WUKUNMENG
 * Date: Jul 5, 2010 9:27:58 AM
 */
package com.ccxe.manage.model;

import java.util.ArrayList;
import java.util.List;

/**
 * @author WUKUNMENG
 * �˵�BEAN
 */
public class MenuBean {

	private String menuId = ""; //菜单ID
	
	private String parentId = ""; //菜单父节点ID
	 
	private String isLeaf = "";   //是否为叶子节点 0非叶子节点 1叶子节点
	
	private String menuName = ""; //菜单名称
	
	private String styleFlag = ""; //布局方式 一般是水平和竖直两种方式
	
	private String menuURL = "";  //菜单的跳转路径
	
	private int menuChildCount = -1; //子节点数量
	
	private List<MenuBean> list = new ArrayList<MenuBean>();

	public String getMenuId() {
		return menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getIsLeaf() {
		return isLeaf;
	}

	public void setIsLeaf(String isLeaf) {
		this.isLeaf = isLeaf;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public String getStyleFlag() {
		return styleFlag;
	}

	public void setStyleFlag(String styleFlag) {
		this.styleFlag = styleFlag;
	}

	public String getMenuURL() {
		return menuURL;
	}

	public void setMenuURL(String menuURL) {
		this.menuURL = menuURL;
	}

	public List<MenuBean> getList() {
		return list;
	}

	public void setList(List<MenuBean> list) {
		this.list = list;
	}
	
	public int getChildCount(List<MenuBean> menuBeans) {
		if(menuBeans == null){
			menuChildCount = 0;
		}
		if (menuChildCount < 0) {
			menuChildCount = 0;
			for(int i = 0;i < menuBeans.size();i++){
				if(menuBeans.get(i).getParentId().equals(this.getMenuId()) && "0".equals(menuBeans.get(i).getStyleFlag())){
					menuChildCount ++;
				}
			}
		}
		return menuChildCount;
	}
	
	
}
